#import "BezierView.h"
#import <appkit/Application.h>
#import "BezierWraps.h"
#import <dpsclient/wraps.h>

@implementation BezierView

+ initialize
{
    if ( self == [BezierView class] )
	{
		// load PostScript procedures SpaceView needs
		// must be careful these are loaded into the correct context
		PSWbezierCreate();
    }
    return self;
}

- oneStep
{
	PSWbezierOneStep();
	return self;
}

- initFrame:(NXRect *)frameRect
{
	[super initFrame:frameRect];
	[self allocateGState];		// For faster lock/unlockFocus
	[self setClipping:NO];		// even faster...

	[self newSize];
	return self;
}

- sizeTo:(NXCoord)width :(NXCoord)height
{
	[super sizeTo:width :height];
	[self newSize];
	return self;
}

- drawSelf:(const NXRect *)rects :(int)rectCount
{
	if (!rects || !rectCount) return self;
	
	PSsetgray(0);
	//NXRectFill(rects);

	return self;
}

- newSize
{
	//this keeps the bezier size legal
	PSWbezierInit(bounds.size.width, bounds.size.height);
	return self;
}

@end
